import 'package:flutter_test/flutter_test.dart';
import 'package:my_toast/my_toast.dart';
import 'package:my_toast/my_toast_platform_interface.dart';
import 'package:my_toast/my_toast_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMyToastPlatform
    with MockPlatformInterfaceMixin
    implements MyToastPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MyToastPlatform initialPlatform = MyToastPlatform.instance;

  test('$MethodChannelMyToast is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMyToast>());
  });

  test('getPlatformVersion', () async {
    MyToast myToastPlugin = MyToast();
    MockMyToastPlatform fakePlatform = MockMyToastPlatform();
    MyToastPlatform.instance = fakePlatform;

    expect(await myToastPlugin.getPlatformVersion(), '42');
  });
}
